<!doctype html>
<html class="no-js fixed-layout">
<head>
<% include("/common/shop_head.html", {productJS: true}){}%>
<script type="text/javascript">
$().ready( function() {
	// 添加商品浏览记录
	$.addProductHistory("<%if (strutil.length(product.name!) <= 15){%>${product.name}<%}else{%>${strutil.subStringTo(product.name,0,11)}...<%}%>", "${base}${product.htmlFilePath}");
});
</script>
</head>
<body>
<%include("/shop/header.html"){}%>
<div class="am-cf shop-main">
  <!-- content start -->
  <div class="shop-content">
    <div class="shop-content-body">
      <div class="am-g">
        <div class="am-u-md-2 am-hide-sm-only am-text-xs am-padding-right-0">
          <table class="am-table am-table-bordered am-table-compact am-margin-top-xs">
          <thead>
            <tr>
              <th class="am-danger">热销排行</th>
            </tr>
          </thead>
          <tbody>
            <%for(list in hotProductList!){%>
            <tr>
              <td>
                <span class="am-badge am-badge-danger">${listLP.index}</span>
                <%if (strutil.length(list.name) < 15){%>
                <a href="${base}${list.htmlFilePath}" title="${list.name}">${list.name}</a>
                <%}else{%>
                <a href="${base}${list.htmlFilePath}" title="${list.name}">${strutil.subStringTo(list.name,0,11)}...</a>
                <%}%>
              </td>
            </tr>
            <%if (listLP.index == 9){%>
            <%break;%>
            <%}%>
            <%}%>
          </tbody>
          </table>
          <table class="am-table am-table-bordered am-table-compact am-margin-top-xs">
          <thead>
            <tr>
              <th class="am-primary">浏览记录</th>
            </tr>
          </thead>
          <tbody id="productHistoryListDetail">
          </tbody>
          </table>
        </div>
        <div class="am-u-sm-12 am-u-md-10">
          <ol class="am-breadcrumb am-margin-bottom-0">
            <li><span class="am-icon-home"> </span>首页</li>
            <%for(list in pathList){%>
            <li><a href="${base}/shop/product/list?id=${list.id}">${list.name}</a></li>
            <%}%>
          </ol>
          <div class="am-g">
            <div class="am-u-sm-12 am-u-md-4">
              <div class="am-slider am-slider-default" data-am-flexslider>
                <ul class="am-slides">
                  <%for(list in product.productImageList!){%>
                  <li>
                    <img src="${base}${list.smallProductImagePath}" />
                  </li>
                  <%}%>
                  <%if (product.productImageList == null){%>
                  <li>
                    <img src="${base}${systemConfig.defaultSmallProductImagePath}" />
                  </li>
                  <%}%>
                </ul>
              </div>
            </div>
            <div class="am-u-sm-12 am-u-md-8">
              <strong>${product.name!}</strong>
              <ul class="am-avg-sm-1 am-avg-md-2 am-text-xs">
                <%var index = 1;%>
                <%for(list in product.productType.enabledProductAttributeList!){%>
                <%if (product.productAttributeMap != null){%>
                <li>
                  <span>${list.name}:</span>
                  <span class="am-kai">${product.productAttributeMap[list.id]}&nbsp;</span>
                </li>
                <%if (index == 6){%>
                <%break;%>
                <%}%>
                <% index = index + 1; %>
                <%}%>
                <%}%>
              </ul>
              <div class="am-panel am-panel-default am-text-xs am-margin-top-xs">
                <div class="am-panel-bd am-padding-0">
                  <ul class="am-avg-sm-2 am-text-xs">
                    <li>销售价：<span class="am-text-danger">${product.price,priceCurrencyFormat}</span></li>
                    <li>市场价：<del>${product.marketPrice,priceCurrencyFormat}</del></li>
                    <%if (product.weight > 0){%>
                    <li>重量：<span>${product.weight} ${i18n("WeightUnit." + product.weightUnit)}</span></li>
                    <%}%>
                    <%if (product.point != 0){%>
                    <li>积分：<span>${product.point}</span></li>
                    <%}%>
                    <li>货号：<span>${product.productSn}</span></li>
                    <li>${"品牌：<span>" + product.brand.name! + "</span>"}</li>
                  </ul>
                </div>
              </div>
              <div class="am-panel am-panel-default">
                <div class="am-panel-bd am-g">
                  <div class="am-u-md-12 am-u-lg-6">
                    <div class="am-input-group am-input-group-sm">
                      <span class="am-input-group-btn">
                        <button class="am-btn am-btn-default" type="button" disabled="disabled">我要购买</button>
                      </span>
                      <input type="number" class="am-form-field" id="quantity" value="1">
                      <span class="am-input-group-btn">
                        <button class="am-btn am-btn-default" type="button" disabled="disabled">件</button>
                      </span>
                    </div>
                  </div>
                  <div class="am-u-md-12 am-hide-lg-only am-margin-xs"></div>
                  <div class="am-u-md-12 am-u-lg-6">
                    <%if (product.isOutOfStock){%>
                    <button type="button" class="am-btn am-btn-danger am-btn-sm" disabled="disabled">库存不足</button>
                    <%}else{%>
                    <button type="submit" class="am-btn am-btn-success am-btn-sm addCartItem {id: '${product.id}'}">加入购物车</button>
                    <%}%>
                    <button type="button" class="am-btn am-btn-warning am-btn-sm addFavorite {id: '${product.id}'}">收藏商品</button>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <hr />
          <div class="am-tabs am-text-xs" data-am-tabs id="tab">
            <ul class="am-tabs-nav am-nav am-nav-tabs">
              <li class="am-active"><a href="#tab1">商品介绍</a></li>
              <li><a href="#tab2">规格参数</a></li>
            </ul>
            
            <div class="am-tabs-bd">
              <div class="am-tab-panel am-fade am-in am-active" id="tab1">
                ${product.description}
              </div>
              <div class="am-tab-panel am-fade" id="tab2">
                <table class="am-table am-table-bordered am-table-striped am-table-compact">
                  <%for(list in product.productType.enabledProductAttributeList!){%>
                  <%if (product.productAttributeMap != null){%>
                  <tr>
                    <th>${list.name}</th>
                    <td>
                      ${product.productAttributeMap[list.id]}&nbsp;
                    </td>
                  </tr>
                  <%}%>
                  <%}%>
                </table>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <%include("/shop/footer.html"){}%>
  </div>
  <!-- content end -->
</div>
</body>
</html>

			